package com.woniu.supermarket.service.impl;

import com.woniu.supermarket.mapper.PurchaseDetailMapper;
import com.woniu.supermarket.service.IPurchaseDetailService;
import com.woniu.supermarket.vo.PurchaseDetailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PurchaseDetailServiceImpl implements IPurchaseDetailService {


    @Autowired
    PurchaseDetailMapper purchaseDetailMapper;

    @Override
    public List<PurchaseDetailVo> findAllPurchaseDetailByPurchaseId(Integer id) {
        return purchaseDetailMapper.selectAllPurchaseDetailByPurchaseId(id);
    }


    /**
     * 根据采购单编号查询采购单详情
     * @param purchaseNumber 采购单编号
     * @return
     */
    @Override
    public List<PurchaseDetailVo> findAllPurchaseDetailByPurchaseNumber(String purchaseNumber) {
        return purchaseDetailMapper.selectAllPurchaseDetailByPurchaseNumber(purchaseNumber);
    }
}
